<?php 
class notificaController extends CController{
    public $model_name = 'notificacao/notifica';
    //protected $blocked_actions = array('formulario');
    public function __construct($vars) {
        parent::__construct($vars);
        $this->addToFreeCod('count');
    }
    
    public function index($display = true, $link = ""){
        $this->setPage();
        if($this->getTag('page_title') == "") $this->genTags("Minhas Notificações");
        $this->model->setAllRead();
        $this->registerVar("item"        , $this->model->paginate($this->page, CURRENT_PAGE));
        $this->registerVar("comp_action" , $this->getIndexListType());
    	$this->display(LINK ."/index");
    }
    
    public function count(){
        $var['total'] = $this->model->getPaginationCount();
        echo json_encode($var);
    }

}
?>